package com.example.demo.mapper;

import com.example.demo.model.Teacher;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import static org.junit.jupiter.api.Assertions.*;
@SpringBootTest
class TeacherMapperTest {

    @Autowired
    private TeacherMapper teacherMapper;

    @Test
    void findAll() {
        teacherMapper.findAll();
    }

    @Test
    void get() {
        teacherMapper.get(3);
    }

    @Test
    void delete() {
        teacherMapper.delete(3);
    }

    @Test
    void save() {
        Teacher teacher = new Teacher();
        teacher.setName("TPM");
        teacher.setTel("12033990023");
        teacherMapper.save(teacher);
    }

    @Test
    void update() {
        Teacher teacher = new Teacher();
        teacher.setId(3);
        teacher.setName("TOM");
        teacher.setTel("123456");
        teacherMapper.update(teacher);
    }
}